﻿@model SpotModel
@using Nop.Core.Infrastructure;
@using Nop.Web.Models.WindAlert;
@{
    Layout = "~/Views/Shared/_ColumnsTwo.cshtml";

    //title
    Html.AddTitleParts(!String.IsNullOrEmpty(Model.MetaTitle) ? Model.MetaTitle : Model.Name);
    Html.AddMetaDescriptionParts(Model.MetaDescription);
    Html.AddMetaKeywordParts(Model.MetaKeywords);
}

<div class="panel panel-default form-panel spot-page">
    <div class="panel-heading">
        <h3>@Model.Name</h3>
    </div>
    <div class="panel-body">
        <div class="row">
            <div class="col-md-8">
                <div class="row">
                    @if (Model.Station != null)
                    {
                        <div class="col-md-6">
                            <div class="offer offer-default">
                                <div class="text">
                                    @Html.Partial("_SpotWindBox", Model)
                                </div>
                            </div>
                        </div>
                    }
                    @if (Model.WaveData != null)
                    {
                        <div class="col-md-6">
                            <div class="offer offer-default">
                                <div class="text">
                                    @Html.Partial("_SpotWaveBox", Model)
                                </div>
                            </div>
                        </div>
                    }
                </div>
                <div class="row">
                    <div class="col-md-12">
                        <h3>@T("Windalert.Spot.Comments")</h3>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-12">
                        @Html.Action("SpotCommentsList", "WSpot", new { spotId = Model.Id })
                    </div>
                </div>
            </div>
            <div class="col-md-4">
                <div class="offer offer-default">
                        @if (Model.AvailableCameras.Count > 0)
                        {
                            @Html.Partial("_SpotCameraBox", Model)
                        }
                        else
                        {
                            @Html.Widget("spot_camera_box")
                        }
                </div>
            </div>
        </div>
    </div>
</div>

@if (!Model.IsAuthenticated)
{
    @Html.Action("Login", "WCustomer");
    <script type="text/javascript">
        $(window).load(function () {
            $('#myModal').modal('show');
        });

        $(document).ready(function () {
            $('#myModal').on('hidden.bs.modal', function () {
                window.location.href = "@(Url.RouteUrl("Login"))";
            })
        });
    </script>
}